﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls.WebParts;
using spSitePro.TagCloudWP.Resources;

namespace spSitePro.TagCloudWP
{
	[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
	public sealed class LocalizedWebDisplayNameAttribute : WebDisplayNameAttribute
	{
		private bool _isLocalized;

		public LocalizedWebDisplayNameAttribute(string displayName)
			: base(displayName)
		{
		}

		public override string DisplayName
		{
			get
			{
				if (!_isLocalized)
				{
					DisplayNameValue = spSitePro_TagCloudWP.ResourceManager.GetString(base.DisplayName, 
																						spSitePro_TagCloudWP.Culture);
					_isLocalized = true;
				}
				return base.DisplayName;
			}
		}
	}
}
